package fun.ticsmyc.rpc;

import fun.ticsmyc.rpc.server.ServerStarter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.util.concurrent.ExecutionException;

/**
 * @author Ticsmyc
 * @date 2020-11-23 16:18
 */
@Configuration
@ComponentScan("fun.ticsmyc.rpc")
public class TrpcStarter {
    private static final Logger logger = LoggerFactory.getLogger(TrpcStarter.class);

    @Autowired
    private ServerStarter serverStarter;

    @PostConstruct
    public void start() throws ExecutionException, InterruptedException {

        serverStarter.start();
        logger.info("TRPC启动完毕");
    }
}
